PROJECT(qtsourceview)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
set(QTSOURCEVIEW_VERSION "0.0.3")
set(QTSOURCEVIEW_SOVERSION "0")

# $Id$
# definitions for the project
# SET( CMAKE_VERBOSE_MAKEFILE  ON )
SET( QT_USE_QTXML TRUE )
SET( QT_USE_QTGUI TRUE )
FIND_PACKAGE( Qt4 REQUIRED )
INCLUDE(${QT_USE_FILE})

# input files
SET( QTSOURCEVIEW_SRCS
	qsvcolordef.cpp 
	qsvcolordeffactory.cpp 
	qsvlangdef.cpp 
	qsvlangdeffactory.cpp 
	qsvsyntaxhighlighter.cpp 
)
# SET( qtsourceview_MOC_HDRS	qorderedmap.h qsvcolordef.h qsvcolordeffactory.h qsvlangdef.h qsvlangdeffactory.h qsvsyntaxhighlighter.h debug_info.h )
SET( QTSOURCEVIEW_RCS		qtsourceview.qrc )

# qt4 definitinos
QT4_AUTOMOC       ( ${QTSOURCEVIEW_SRCS} )
QT4_WRAP_CPP      ( QTSOURCEVIEW_MOC_SRCS ${QTSOURCEVIEW_MOC_HDRS} )
QT4_ADD_RESOURCES ( QTSOURCEVIEW_RC_SRCS ${QTSOURCEVIEW_RCS} )

# build the file
#INCLUDE_DIRECTORIES	( ${CMAKE_BINARY_DIR} )
ADD_LIBRARY( QTSOURCEVIEW_STATIC STATIC ${QTSOURCEVIEW_SRCS} ${QTSOURCEVIEW_MOC_SRCS} ${QTSOURCEVIEW_RC_SRCS} )
ADD_LIBRARY( QTSOURCEVIEW_SHARED SHARED ${QTSOURCEVIEW_SRCS} ${QTSOURCEVIEW_MOC_SRCS} ${QTSOURCEVIEW_RC_SRCS} )
set_target_properties(
  QTSOURCEVIEW_SHARED
    PROPERTIES
      VERSION     ${QTSOURCEVIEW_VERSION}
      SOVERSION   ${QTSOURCEVIEW_SOVERSION}
)

if(MSVC)
	set_target_properties(QTSOURCEVIEW_STATIC PROPERTIES OUTPUT_NAME qsvsh_static)
	set_target_properties(QTSOURCEVIEW_SHARED PROPERTIES OUTPUT_NAME qsvsh)
else()
	set_target_properties(QTSOURCEVIEW_STATIC PROPERTIES OUTPUT_NAME qsvsh)
	set_target_properties(QTSOURCEVIEW_SHARED PROPERTIES OUTPUT_NAME qsvsh)
endif()

INCLUDE_DIRECTORIES( ../  ${CMAKE_BINARY_DIR} )
ADD_EXECUTABLE(DEMO1 ../demos/demo1/main1.cpp)
TARGET_LINK_LIBRARIES(DEMO1 ${QT_LIBRARIES} QTSOURCEVIEW_STATIC)
SET_TARGET_PROPERTIES(DEMO1 PROPERTIES OUTPUT_NAME qsvsh-demo1)

QT4_WRAP_UI ( DEMO2_UI ../../demos/demo2/mainwindow2.ui )
QT4_WRAP_CPP( DEMO2_MOC ../../demos/demo2/mainwindow2.h )
ADD_EXECUTABLE(DEMO2 ../../demos/demo2/main2.cpp ../../demos/demo2/mainwindow2.cpp ${DEMO2_UI} ${DEMO2_MOC})
TARGET_LINK_LIBRARIES(DEMO2 ${QT_LIBRARIES} QTSOURCEVIEW_STATIC)
SET_TARGET_PROPERTIES(DEMO2 PROPERTIES OUTPUT_NAME qsvsh-demo2)

# ADD_EXECUTABLE(DEMO1 ../../demos/demo1/main1.cpp)
# TARGET_LINK_LIBRARIES(DEMO1 QATE_STATIC ${QT_LIBRARIES} )
# SET_TARGET_PROPERTIES(DEMO1 PROPERTIES OUTPUT_NAME qsvsh-demo1)
